/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.src.ptit.javatraining.huynh.btvn2;

import java.io.BufferedReader;
import java.io.FileReader;
import java.util.Stack;
import java.util.Vector;

/**
 *
 * @author user
 */
public class Bai10 {

    static int nto(long a) {
        if (a < 2) {
            return 0;
        }
        for (long i = 2; i <= Math.sqrt(a); i++) {
            if (a % i == 0) {
                return 0;
            }
        }
        return 1;
    }

    public static void main(String[] args) {
        try {
            FileReader f10 = new FileReader("Bai10.in");
            BufferedReader fin = new BufferedReader(f10);
            Vector s1 = new Vector();
            while (fin.ready()) {
                String s;
                long a;
                s = fin.readLine();
                if (s.length() < 1) {
                    throw new Exception("Xau rong !");
                }
                while (s.indexOf("  ") != -1) {

                    s = s.replaceAll("  ", " ");
                }
                String s2[] = s.split(" ");
                for (int i = 0; i < s2.length; i++) {
                    a = Long.parseLong(s2[i]);
                    if (a < 0) {
                        throw new Exception("So < 0 !");
                    }
                    if (nto(a) == 1) {
                        if (s1.isEmpty()) {
                            s1.addElement(a);
                        } else {
                            if (s1.contains(a) == false) {
                                s1.add(a);
                            };
                        }
                    }
                }
            }
            System.out.println(s1.size());
        } catch (Exception e) {
            System.out.println("Error " + e);
        }
    }
}
